package com.zf.zffencheng.controller.admin;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zf.zffencheng.model.Result;
import com.zf.zffencheng.model.dto.PalaceRegionFilter;
import com.zf.zffencheng.model.pojo.PalaceRegion;
import com.zf.zffencheng.model.vo.PalaceRegionVo;
import com.zf.zffencheng.service.TenantPalaceRegionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * ClassName: AdminPalaceRegionController <br/>
 * Description:  <br/>
 * date: 2021/5/31 14:39<br/>
 *
 * @author william <br/>
 */
@RestController
@RequestMapping("/sapi/admin/tenant/palace/region")
@Api(tags = "区域")
public class AdminPalaceRegionController {
    @Autowired
    private TenantPalaceRegionService tenantPalaceRegionService;

    @GetMapping("query")
    @ApiOperation("区域列表")
    public Result query(PalaceRegionFilter filter){
        Page<PalaceRegion> page = tenantPalaceRegionService.queryFilter(filter);
        Map<String, Object> map = new HashMap<>(2);
        map.put("list", page.getRecords());
        map.put("count", page.getTotal());
        return Result.ok(map);
    }
}
